const curry =(fn,...args)=>
    args.length>=fn.length
    ? fn(...args)
    : (..._args)=>curry(fn,...args,..._args)


function dynamicAdd() {
    return [...arguments].reduce((prev, curr) => {
      return prev + curr
    }, 0)
}
let add = curry(dynamicAdd)
console.log(add(1,2,3));